package com.ean.backpack.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ean.backpack.domain.Regioneanhotelidmapping;
import com.ean.backpack.domain.RegioneanhotelidmappingPK;
import com.ean.backpack.repository.RegioneanhotelidmappingRepository;
import com.ean.backpack.service.RegioneanhotelidmappingService;

@Service
@Transactional
public class RegioneanhotelidmappingServiceImpl implements
		RegioneanhotelidmappingService {

	@Autowired
	RegioneanhotelidmappingRepository regioneanhotelidmappingRepository;

	public long countAllRegioneanhotelidmappings() {
		return regioneanhotelidmappingRepository.count();
	}

	public void deleteRegioneanhotelidmapping(
			Regioneanhotelidmapping regioneanhotelidmapping) {
		regioneanhotelidmappingRepository.delete(regioneanhotelidmapping);
	}

	public Regioneanhotelidmapping findRegioneanhotelidmapping(
			RegioneanhotelidmappingPK id) {
		return regioneanhotelidmappingRepository.findOne(id);
	}

	public List<Regioneanhotelidmapping> findAllRegioneanhotelidmappings() {
		return regioneanhotelidmappingRepository.findAll();
	}

	public List<Regioneanhotelidmapping> findRegioneanhotelidmappingEntries(
			int firstResult, int maxResults) {
		return regioneanhotelidmappingRepository.findAll(
				new org.springframework.data.domain.PageRequest(firstResult
						/ maxResults, maxResults)).getContent();
	}

	public void saveRegioneanhotelidmapping(
			Regioneanhotelidmapping regioneanhotelidmapping) {
		regioneanhotelidmappingRepository.save(regioneanhotelidmapping);
	}

	public Regioneanhotelidmapping updateRegioneanhotelidmapping(
			Regioneanhotelidmapping regioneanhotelidmapping) {
		return regioneanhotelidmappingRepository.save(regioneanhotelidmapping);
	}
}
